package saleweixin.invocation;

import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
import play.Logger;
import saleweixin.WxMpContext;
import saleweixin.WxMpInvocation;

/**
 * 更新地理位置的请求
 */
public class LocationInvocation extends WxMpInvocation {

    @Override protected WxMpXmlOutMessage doExecute(WxMpContext context) {
        WxMpXmlMessage inMessage = context.inMessage;
        Logger.info("WxMpXmlMessage : %s" , context.inMessage);
        Logger.info("inMessage.getEvent() :" + inMessage.getEvent() + " | longitude :" + inMessage.getLongitude() + " | latitude :" + inMessage.getLatitude() + "----------");
        return null;
    }

    @Override protected boolean matchEvent(String event, String eventKey) {
        Logger.info("LocationInvocation : %s  | key : %s" , event , eventKey);
        return WxConsts.EVT_LOCATION.equals(event);
    }
}
